package com.yifeng.repo.base.service.impl;

import com.yifeng.base.mcs.api.VoiceRestService;
import com.yifeng.base.mcs.api.params.SendVoiceMsgParam;
import com.yifeng.repo.base.params.ConsoleParam;
import com.yifeng.repo.base.security.proxy.CommonProxy;
import com.yifeng.repo.base.utils.converter.JacksonHelper;

/**
 * Created by daibing on 2024/5/11.
 */
public class VoiceRestServiceImpl extends CommonProxy implements VoiceRestService {
    private final String mapping;

    public VoiceRestServiceImpl(ConsoleParam consoleParam) {
        super(consoleParam);
        this.mapping = "/yfcloud-mcs/rest/voice/VoiceRestService";
    }

    @Override
    public Long sendVoiceMsg(SendVoiceMsgParam param) {
        String url = consoleParam.getUrl() + mapping + "/voiceCall";
        String body = JacksonHelper.toJson(param);
        return this.doActionCallByRpc(url, body, Long.class);
    }
}
